home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / perl5 / GnuPG / UserAttribute.pm < prev    next >
Encoding:
Perl POD Document  |  2010-05-10  |  2.7 KB  |  120 lines

  1. #  UserAttribute.pm
  2. #    - providing an object-oriented approach to GnuPG user attributes
  3. #
  4. #  Copyright (C) 2010 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
  5. #  (derived from UserId.pm, Copyright (C) 2000 Frank J. Tobin <ftobin@cpan.org>)
  6. #
  7. #  This module is free software; you can redistribute it and/or modify it
  8. #  under the same terms as Perl itself.
  9. #
  10. #  This program is distributed in the hope that it will be useful,
  11. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. #  $Id: UserId.pm,v 1.7 2001/08/21 13:31:50 ftobin Exp $
  15. #
  16.  
  17. package GnuPG::UserAttribute;
  18. use Any::Moose;
  19.  
  20. has [qw( validity subpacket_count subpacket_total_size )] => (
  21.     isa => 'Any',
  22.     is  => 'rw',
  23. );
  24.  
  25. has signatures => (
  26.     isa       => 'ArrayRef',
  27.     is        => 'rw',
  28.     default   => sub { [] },
  29. );
  30. has revocations => (
  31.     isa       => 'ArrayRef',
  32.     is        => 'rw',
  33.     default   => sub { [] },
  34. );
  35.  
  36. sub push_signatures {
  37.     my $self = shift;
  38.     push @{ $self->signatures }, @_;
  39. }
  40. sub push_revocations {
  41.     my $self = shift;
  42.     push @{ $self->revocations }, @_;
  43. }
  44.  
  45. __PACKAGE__->meta->make_immutable;
  46.  
  47. 1;
  48.  
  49. __END__
  50.  
  51. =head1 NAME
  52.  
  53. GnuPG::UserAttribute - GnuPG User Attribute Objects
  54.  
  55. =head1 SYNOPSIS
  56.  
  57.   # assumes a GnuPG::PublicKey object in $publickey
  58.   my $jpgs_size = $publickey->user_attributes->[0]->subpacket_total_size();
  59.  
  60. =head1 DESCRIPTION
  61.  
  62. GnuPG::UserAttribute objects are generally not instantiated on their
  63. own, but rather as part of GnuPG::PublicKey or GnuPG::SecretKey
  64. objects.
  65.  
  66. =head1 OBJECT METHODS
  67.  
  68. =over 4
  69.  
  70. =item new( I<%initialization_args> )
  71.  
  72. This methods creates a new object.  The optional arguments are
  73. initialization of data members;
  74.  
  75. =back
  76.  
  77. =head1 OBJECT DATA MEMBERS
  78.  
  79. =over 4
  80.  
  81. =item validity
  82.  
  83. A scalar holding the value GnuPG reports for the calculated validity
  84. of the binding between this User Attribute packet and its associated
  85. primary key.  See GnuPG's DETAILS file for details.
  86.  
  87. =item subpacket_count
  88.  
  89. A scalar holding the number of attribute subpackets.  This is usually
  90. 1, as most UATs seen in the wild contain a single image in JPEG
  91. format.
  92.  
  93. =item subpacket_total_size
  94.  
  95. A scalar holding the total byte count of all attribute subpackets.
  96.  
  97. =item signatures
  98.  
  99. A list of GnuPG::Signature objects embodying the signatures
  100. on this user attribute.
  101.  
  102. =item revocations
  103.  
  104. A list of revocations associated with this User Attribute, stored as
  105. GnuPG::Signature objects (since revocations are a type of
  106. certification as well).
  107.  
  108. =back
  109.  
  110. =head1 BUGS
  111.  
  112. No useful information about the embedded attributes is provided yet.
  113. It would be nice to be able to get ahold of the raw JPEG material.
  114.  
  115. =head1 SEE ALSO
  116.  
  117. L<GnuPG::Signature>,
  118.  
  119. =cut
  120.